package com.gmu.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gmu.domain.vo.TblSampleVo;
import com.gmu.pojo.TblActivities;
import com.gmu.pojo.TblSample;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 采样记录表 Mapper 接口
 * </p>
 *
 * @author testjava
 * @since 2022-07-24
 */
public interface TblSampleMapper extends BaseMapper<TblSample> {

    List<TblSample> getUserSampleByUserId(@Param("userId") Integer userId);

    IPage<TblActivities> getSampleRecordList(Page<TblActivities> page,@Param("tblSample") TblSampleVo tblSample,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    int deleteSampleRecord(Integer[] sampleRecordIds);

    List<TblSample> getAllSampleByPage(Map<String,Object> map);

    List<TblSampleVo> getSampleVoList( @Param("tblSample") TblSampleVo tblSample,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    List<TblSample> getStudentByActivitiesId(@Param("activitiesId") Integer activitiesId);

    List<TblSample> getTeacherByActivitiesId(@Param("activitiesId") Integer activitiesId);

    List<TblSample> getSampleRecordByArea(Integer activitiesId, Integer unitsId, Integer status);

    Integer selectCountSample(String idNumber, Integer activitiesId);

    Integer getSampleByIdNumberAndActivitiesId(String idNumber, Integer activitiesId, Integer status);

    TblSample getSampleByIdNumberActivitiesId(String idNumber, Integer activitiesId);

    Integer commitTestTime(String idNumber, Integer activitiesId, Date testTime, Integer status);
}
